import http from '@/utils/http';



/**
 * 删除区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const removeSubStructureCommon = (params: any) => {
  return http.delete('bus/subStructureCommon/remove', {params});
}

/**
 * 获取系统用户列表
 * @param params
 * @returns {*|Promise<any>}
 */
export const getSubStructureCommonList = (params?: any) => {
  return http.get('bus/subStructureCommon/list', {params});
}

export const queryByStructureId = (params?: any) => {
  return http.get('bus/subStructureCommon/queryByStructureId?id=' + params.id);
}


/**
 * 保存修改区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const updateSubStructureCommon = (params: any) => {
  return http.put('bus/subStructureCommon/edit', params);
}

/**
 * 保存新增区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const addSubStructureCommon = (params: any) => {
  return http.post('bus/subStructureCommon/add', params);
}

/**
 * 通过id获取区域信息
 * @param params
 * @returns {*|Promise<any>}
 */
export const getSubStructureCommonById = (params: any) => {
  return http.get('bus/subStructureCommon/' + params.id);
}

/**
 * 验证区域名称是否唯一
 * @param params
 * @returns {*|Promise<any>}
 */
export const checkSubStructureCommonNameUnique = (params: any) => {
  params.loading = false;
  return http.post('bus/subStructureCommon/checkNameUnique', params);
}

